<?php
class ImageHandler implements ExtensionInterface{
	public function handleExtension($file) {
		$headerInfo = '<script type="text/javascript" src="'.Settings::getInstance()->getSetting('General.urlToCMS').'kernel/contentExtensionHandler/lightbox/lightbox.js"></script>
<link rel="stylesheet" type="text/css" media="screen" href="'.Settings::getInstance()->getSetting('General.urlToCMS').'kernel/contentExtensionHandler/lightbox/lightbox.css" />';
		
		if(strpos(General::getInstance()->getGlobalVar("additionalHeader"),$headerInfo) === false) {
			General::getInstance()->addAdditionalHeaderInfo($headerInfo);
		}
		return "<a href='".Settings::getInstance()->getSetting("General.urlToCMS")."content/".$file."' rel='lightbox'><img src='".Settings::getInstance()->getSetting("General.urlToCMS")."content/".$file."' width='150' /></a>";
	}
	
	public function getHandledExtensions() {
		return array("jpg","gif","png");
	}
}
?>